]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Fix wrong separator position
authorRaghuveer Kasaraneni <raghu@kasara.net>
Sun, 5 Sep 2021 08:33:18 +0000 (10:33 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 21 Nov 2025 12:17:33 +0000 (12:17 +0000)
The separator position takes drag placeholders into account, but not
any removed favorites that are currently animating out.

As a result, we may end up with the wrong position and some app icons appear
on the wrong side of the separator.

To fix, account for all items before the separator that are currently
animating out.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3966
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3799
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1973>

js/ui/dash.js

index 66b3b4a900615de640e98ba3fcba264d77083317..e42f42e272d6be364042c33bbe3ebcee06e1742d 100644 (file)
@@ -821,7 +821,17 @@ export const Dash = GObject.registerClass({
                 });
                 this._box.add_child(this._separator);
             }
-            let pos = nFavorites + this._animatingPlaceholdersCount;
+            let pos = nFavorites;
+            let itemsBeforeSeparator = 0;
+            for (const item of this._box.get_children()) {
+                if (item.animatingOut)
+                    pos++;
+                itemsBeforeSeparator++;
+                // Assuming only one icon is moved at a time
+                // Or else we need to track removed favorite items
+                if (itemsBeforeSeparator > nFavorites)
+                    break;
+            }
             if (this._dragPlaceholder)
                 pos++;
             this._box.set_child_at_index(this._separator, pos);